//
//  DHAppManager.m
//  dancingPartner
//
//  Created by Apple on 2018/11/7.
//  Copyright © 2018年 haoniu. All rights reserved.
//

#import "DCAppManager.h"

@implementation DCAppManager

+(instancetype)sharedInstance{
    static DCAppManager * appManager;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        appManager=[[DCAppManager alloc]init];
//        //读取用户信息
//        appManager.currentUser = [DHMemberInfoModel mj_objectWithKeyValues:[DCObjectManager dc_readUserDataForKey:DC_UserInfo_Key]];
//        appManager.currentUserToken = [DCObjectManager dc_readUserDataForKey:DC_Token_Key];
//        //读取字体修正大小
//        if ([DCObjectManager dc_readUserDataForKey:@"fontCorrect"]) {
//            appManager.fontCorrect = [[DCObjectManager dc_readUserDataForKey:@"fontCorrect"] integerValue];
//        }
        
    });
    return appManager;
}
////更新字体修正大小
//-(void)setFontCorrect:(NSInteger)fontCorrect{
//    [DCObjectManager dc_saveUserData:[NSString stringWithFormat:@"%ld",(long)fontCorrect] forKey:@"fontCorrect"];
//    _fontCorrect = fontCorrect;
//}


//获取聊天用户数据
-(void)InitChatUserInfo{
    //FMDB存储
//    NSArray * users = [FMDBManager queryUsers];
//    NSMutableArray * ids = [NSMutableArray array];
//    for (NSDictionary * user in users) {
//        //UserProfileEntity *entity = [UserProfileEntity initWithFMDBNSDictionary:user];
//        if (![DHAppConfig isNULL:user[@"userId"]]) {
//            [self.chatUserInfoList setObject:user forKey:[NSString stringWithFormat:@"%@",user[@"userId"]]];
//            [ids addObject:[NSString stringWithFormat:@"%@",user[@"userId"]]];
//        }
//    }
//    __weak typeof(self) weakSelf = self;
//    [DHAPI GET:url_user_getUserInfoList Param:@{@"ids":[ids componentsJoinedByString:@","]} Result:^(id  _Nullable responseObject, NSError * _Nonnull error) {
//        DHResultModel * retmodel = [DHUserInfoModel dh_setModelByData:responseObject];
//        if (retmodel.retSuccess) {
//            for (DHUserInfoModel * u in retmodel.retData) {
//                NSDictionary * uDict = @{@"userId":[NSString stringWithFormat:@"%@",u.userId],@"nickName":[NSString stringWithFormat:@"%@",u.nickName],@"avatarUrl":[NSString stringWithFormat:@"%@",u.avatarUrl]};
//                [weakSelf.chatUserInfoList setObject:uDict forKey:[NSString stringWithFormat:@"%@",u.userId]];
//            }
//
//        }
//    } FailureBlock:^(NSError * _Nonnull error) {
//
//    }];
}

-(void)InitNetwork{
//    __weak typeof(self) weakSelf = self;
//    AFNetworkReachabilityManager * reaManager = [AFNetworkReachabilityManager sharedManager];
//    [reaManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) {
//        // 当网络状态改变时调用
//        switch (status) {
//                case AFNetworkReachabilityStatusUnknown:
//                NSLog(@"InitNetwork 网络检测结果：未知网络");
//                break;
//                case AFNetworkReachabilityStatusNotReachable:
//                NSLog(@"InitNetwork 网络检测结果：没有网络");
//                break;
//                case AFNetworkReachabilityStatusReachableViaWWAN:
//                NSLog(@"InitNetwork 网络检测结果：手机自带网络");
//                break;
//                case AFNetworkReachabilityStatusReachableViaWiFi:
//                NSLog(@"InitNetwork 网络检测结果：WIFI");
//                break;
//        }
//        weakSelf.networkStatus = status;
//        [reaManager stopMonitoring];
//    }];
//    [reaManager startMonitoring];
}

@end
